<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <title>详情</title>
    <link rel="stylesheet" href="../../../assert/css/font.css"/>
    <link rel="stylesheet" href="../../../assert/css/bootstrap.min.css">
    <link href="../../../assert/css/plugin/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="../../../assert/css/plugin/toastr/toastr.min.css" rel="stylesheet">
    <link rel="stylesheet" href="../../../assert/css/plugin/chosen/chosen.css">
    <link href="../../../assert/css/loaders.css" rel="stylesheet">
    <link href="../../../assert/css/plugin/jsTree/themes/default/style.css" rel="stylesheet"
          th:href="@{/assert/css/plugin/jsTree/themes/default/style.css}">
    <link rel="stylesheet" href="../../../assert/css/animate.min.css" th:href="@{/assert/css/animate.min.css}"/>
    <link rel="stylesheet" href="../../../assert/css/subpagesCss/detail.css" th:href="@{/assert/css/subpagesCss/detail.css(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}">
</head>
<body>
<!--头部基本信息-->
<fieldset class="base">
    <legend class="on hidden" data-title="概况">
        概况 <span class="fa fa-angle-down"></span>
    </legend>
    <div class="fieldset_box">
        <div class="baseBox" style="overflow: hidden;height:60px;">
            <ul class="baseUl">
                <li style="width:800px;">录音流水号:<span id="audioId" style="max-width:700px;"></span></li>
            </ul>
            <ul class="baseUl">
                <li>坐席班组:<span id="seatGroup"></span></li>
                <li>坐席工号:<span id="seatWorker"></span></li>
                <li>姓名:<span id="seatName"></span></li>
                <li>客户归属地:<span id="customerloc"></span></li>
                <li>客户星级:<span id="customerLevel"></span> <i style="cursor:pointer;margin-left:15px;color: #337ab7;" id="baseChange">展开<b class="fa fa-angle-double-down"></b></i></li>
            </ul>
            <ul class="baseUl">
                <li>通话开始时间:<span id="phoneStartTime"></span></li>
                <li>通话结束时间:<span id="phoneEndTime"></span></li>
                <li>通话时长:<span id="timeDur">38</span></li>
                <li>受理号码:<span id="proPhoneNum"></span></li>
                <li>客户号码:<span id="phone"></span></li>
            </ul>
            <ul class="baseUl">
                <li>满意度:<span id="satisfaction"></span></li>
                <li>呼叫类型:<span id="callType"></span></li>
                <li>挂机方:<span id="onHook"></span></li>
                <li style="width:15%">是否重复来电:<span id="reCallFlag"></span></li>
            </ul>
        </div>
        <div class="wave_box">
            <div class="wave">
                <div class="speakerModel-player"></div>
                <div class="waveTime_one"></div>
                <div id="sp-player-wrapper">
                    <div id="sp-player-loadDiv" class="progress progress-striped active"
                         style="display:block;position: absolute;top: 54%;">
                        <div id="sp-player-loadBar" class="progress-bar progress-bar-info" role="progressbar"
                             aria-valuenow="0"
                             aria-valuemin="0" aria-valuemax="100">0%
                        </div>
                    </div>
                </div>
                <div class="btn-group-wrapper">
                    <div class="btn-group" role="group">
                        <button type="button" class="btn btn-sm" title="播放/暂停" data-action="speakerModel-play-btn"
                                onclick="wave.playPause()" id="playStopTab" style="color:#337ab7"><span
                                class="glyphicon glyphicon-play"></span>
                        </button>
                        <button type="button" class="btn btn-sm" title="停止" data-action="speakerModel-stop-btn"
                                onclick="wave.stop()"><span
                                class="glyphicon glyphicon-stop"></span></button>
                        <button type="button" class="btn btn-sm" title="快退"
                                data-action="speakerModel-skip-backward-btn"
                                onclick="wave.skipBackward(wave.skipLength)"><span
                                class="glyphicon glyphicon-backward"></span></button>
                        <button type="button" class="btn btn-sm" title="快进"
                                data-action="speakerModel-skip-forward-btn"
                                onclick="wave.skipForward(wave.skipLength)"><span
                                class="glyphicon glyphicon-forward"></span></button>
                        <button type="button" class="btn fa fa-search-minus" href="#"
                                onclick="wave.zoomAudioOut()" title="缩小波形"></button>
                        <div class="btn-group" style="width:100px;display: none;"><!-- type="range" 有step限制-->
                            <input id="myPlayer-room-input" min="1" max="100" value="1"
                                   width=100 height=22/>
                        </div>
                        <button type="button" class="btn fa fa-search-plus" href="#"
                                onclick="wave.zoomAudioIn()" title="放大波形"></button>
                        <button type="button" class="btn fa fa-dot-circle-o" href="#"
                                onclick="wave.zoomAudio()" title="全波形"></button>
                        <button type="button" class="btn btn-sm audioBtn prePhone hidden" title="上一条语音"><span
                                class="glyphicon glyphicon-arrow-up"></span></button>
                        <button type="button" class="btn btn-sm audioBtn nextPhone hidden" title="下一条语音"><span
                                class="glyphicon glyphicon-arrow-down"></span></button>

                        <span style="margin-left:20px;">语速：</span><select name="" id="audioSpeed"></select>
                        <span style="margin-left:20px;">总时长：<b id="totalTime">0</b></span>

                        <span style="margin-left:20px;">跳转到:
                            <input type="text" class="waveInput hour" placeholder="时" autocomplete="off" disabled><i class="waveText">时</i>
                            <input type="text" class="waveInput minute" placeholder="分" autocomplete="off" disabled><i class="waveText">分</i>
                            <input type="text" class="waveInput seconds" placeholder="秒" autocomplete="off" disabled><i class="waveText">秒</i>
                            <button id="jumpBtn">跳转</button>
                        </span>
                        <span style="margin-left:20px;">当前时间：<b id="nowTime">0</b></span>
                        <shiro:hasPermission name="IS_NEED_BZ">
                            <span class="needTagging" style="margin-left:20px;padding:5px 15px; background:#337ab7; color:#fff;  cursor:pointer;border:1px solid #d6d6d6;">转写需标注</span>
                        </shiro:hasPermission>
                    </div>
                </div>
            </div>
        </div>
    </div>
</fieldset>
<!--底部信息-->
<div class="detail_bottom">
    <div class="detail_left">
        <fieldset>
            <legend class="on" data-title="标签">
                <span style="margin-right:10px;">标签</span>(
                <b class="typeCode type0"></b><i>话务小结</i>
                <b class="typeCode type1"></b><i>系统 </i>
                <b class="typeCode type2"></b><i>人工 </i>
                )
                <span class="fa fa-angle-up"></span>
            </legend>
            <div class="fieldset_box">
                <shiro:hasPermission name="TAG_BTN">
                    <button class="fa-btn btn-primary noPer" title="添加标签" id="plusTag">添加标签</button>
                </shiro:hasPermission>
                <ul class="tags">

                </ul>
            </div>
        </fieldset>
        <fieldset class="audio_box" style="margin-bottom:3px">
            <legend class="on" data-title="录音内容">
                录音内容 <span class="fa fa-angle-up"></span>
            </legend>
            <div class="fieldset_box" style="padding-top: 12px;">
                <ul class="stt_box scrollbar">

                </ul>
            </div>
        </fieldset>
    </div>
    <div class="detail_right">
        <fieldset style="margin-bottom:3px;">
            <legend class="on" data-title="">
                <span id="taskName"></span><span id="modelName"></span><span class="fa fa-angle-up"></span>
            </legend>
            <div class="fieldset_box">
                <ul class="rules">
                    <li id="total">分值：<span></span></li>
                    <li id="ruleHit">规则命中量：<span></span></li>
                    <li id="lethality">致命性：<span></span></li>
                    <li id="noLethality">非致命性：<span></span></li>
                    <shiro:hasPermission name="NLP_RETURN_CODE">
                        <li id="errorTip"><span></span></li>
                    </shiro:hasPermission>
                </ul>
                <div class="table_box scrollbar">
                    <table id="table"></table>
                </div>
            </div>
        </fieldset>
    </div>
</div>
<!--删除标签确认框-->
<div class="modal fade" id="tagDelModal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
    <div class="modal-dialog">
        <div class="modal-content">
            <form method="post">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span
                            aria-hidden="true">&times;</span><span
                            class="sr-only">Close</span></button>
                    <h4 class="modal-title">删除标签</h4>
                </div>
                <div class="modal-body">
                    <div style="text-align: center"><span class="fa fa-question-circle"></span>确实要删除 <span
                            id="delName"></span>吗？
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" id="delBtn">确定</button>
                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                </div>
            </form>
        </div>
    </div>
</div>
<!--提交标注确认框-->
<div class="modal fade" id="bzModal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
    <div class="modal-dialog" style="margin-top: 113px;width: 721px;">
        <div class="modal-content">
            <form method="post">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span
                            aria-hidden="true">&times;</span><span
                            class="sr-only">Close</span></button>
                    <h4 class="modal-title">确认</h4>
                </div>
                <div class="modal-body">
                    <div style="text-align: center"><span class="fa fa-question-circle"></span>确实要提交标注吗？</div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" id="bzSubmitBtn">确定</button>
                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                </div>
            </form>
        </div>
    </div>
</div>
<!--需要标注模态框-->
<div class="modal" id="needtagModal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
    <div class="modal-dialog">
        <div class="modal-content">
            <div>
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span
                            aria-hidden="true">&times;</span><span
                            class="sr-only">Close</span></button>
                    <h4 class="modal-title">转写需标注</h4>
                </div>
                <div class="modal-body">
                    <div class="del-question" style="text-align: center">
                        <span class="glyphicon glyphicon-exclamation-sign"></span>
                        确定转写需标注？
                    </div>

                </div>
                <div class="modal-footer" style="text-align:center;">
                    <button type="button" class="btn btn-primary" id="needtagSave">确定</button>
                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                </div>
            </div>

        </div>
    </div>
</div>
<div th:text="${workId}" id="workId" class="hidden"></div>
<div th:text="${modelId}" id="modelId" class="hidden"></div>
<div th:text="${modelName}" id="modelName1" class="hidden"></div>
<div th:text="${serialNumber}" id="serialNumber" class="hidden"></div>
<div th:text="${userIdentity}" id="userIdentity" class="hidden"></div>
<div id="proStatus" class="hidden"></div>
<div id="workName" class="hidden"></div>
<input type="text" id="classify" class="hidden">
<input type="text" id="proSelectModal" class="hidden">

<input type="text" id="modelS" class="hidden">
<input type="text" id="ruleS" class="hidden">
<input type="hidden" id="tagId" value="" class="form-control search_input">
<input type="hidden" id="areaId" value="" class="form-control search_input">
<input type="hidden" id="tagType" value="" class="form-control search_input">

<a id="basePath" th:href="@{/}"></a>
<script src="../../../assert/js/jquery.js"></script>
<script src="../../../assert/js/base.js"></script>
<script src="../../../assert/js/wavesurfer.min.js"></script>
<script src="../../../assert/js/plugin/wavesurfer.timeline.min.js"></script>
<script src="../../../assert/js/plugin/wavesurfer.regions.min.js"></script>
<script src="../../../assert/js/bootstrap.min.js"></script>
<script src="../../../assert/js/plugin/bootstrap-table/bootstrap-table.min.js"></script>
<script src="../../../assert/js/plugin/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="../../../assert/js/plugin/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="../../../assert/js/plugin/toastr/toastr.min.js"></script>
<script src="../../../assert/js/common.js"></script>
<script src="../../../assert/js/plugin/chosen/chosen.jquery.js"></script>
<script src="../../../assert/js/plugin/jsTree/jstree.min.js"></script>
<script src="../../../assert/js/colResizable-1.6.min.js"></script>
<script src="../../../assert/js/jquery.mousewheel.js"></script>
<script src="../../../assert/js/changeTime.js"></script>
<script src="../../../assert/js/detailCommon.js" th:src="@{/assert/js/detailCommon.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script>
    var getData = {//根据id查询单条详情信息
        jumpType:"",
        init: function () {
            getData.getWorkName();
            getData.getJumpSource();//获取跳转来源
        },
        getWorkName: function () {
            var id = $("#workId").text();
            $.ajax({
                type: "post",
                url: basePath + "/rest/per-task/get-task-by-id",
                data: {
                    id: id
                },
                async: false,
                dataType: "json",
                success: function (data) {
                    if (data.code == 0) {
                        var dataOne = data.data;
                        if (dataOne && dataOne.workname) {
                            $("#workName").text(dataOne.workname);
                        }

                    } else {
                        toastrCog.error(data.msg, 1000)
                    }
                }
            })
        },
        getJumpSource:function(){
            var href= window.location.href;
            if(href.indexOf("jumpType=audio")>-1){
                getData.jumpType="audio"
            }
        }
    };
    var resize = {
        init: function () {
            resize.me();
            $(window).resize(function () {
                resize.me();
            })
        },
        me: function () {
            var winW = $(window).width();
            var winH = $(window).height();
            var tabW = $(".detail_right").width();
            $(".baseUl li span").each(function(){
                $(this).css({"maxWidth":($(this).parent("li").width()-135)+"px"});
            });
            $(".speakerModel-player").width(winW - 40);
            $("#sp-player-loadDiv").width(winW - 40);
            $("#modelTableWin").width(tabW - 230);
            $(".stt_box").height(winH - 260 - $('.tags').height()-110);
            $(".table_box").height(winH - 260 - 42 - 39);
            $(".tab1 .fixed-table-body").css("maxHeight",($(".detail_right").height()- 130)+"px");
            $(".tab1 .fixed-table-body").css("maxWidth",($(".detail_right").width()- 190)+"px");

        }
    };
    var tools = {
        scoreTotal: 0,
        ruleTimesTotal: 0,
        fateful: 0,
        noFateful: 0,
        init: function () {
            tools.nlpErrorArr = bs.getStatus("nlp_return_code");
            tools.getScore();
            tools.getNlpError();
        },
        getScore:function(){
            $.ajax({
                type: "post",
                url: basePath + "/rest/pending-task-detail/get-workScore-serialNumber",
                dataType: "json",
                data: {
                    serialNumber: $("#serialNumber").html(),
                    workId: $("#workId").html(),
                    taskType:"model"
                },
                success: function (data) {
                    if (data.code == 0) {
                        $("#total span").html(data.data);
                    }
                }
            })
        },
        getNlpError:function(){
            $.ajax({
                type: "post",
                url: basePath + "/rest/task-audio-search/audio-nlp-status",
                dataType: "json",
                data: {
                    serialNumber: $("#serialNumber").html(),
                    workId: $("#workId").html(),
                    type:"test"
                },
                success: function (data) {
                    if (data.code == 0) {
                        var res = data.data;
                        if(res == null){
                            res = ''
                        }
                        $("#errorTip span").html(bs.getXInY(tools.nlpErrorArr,'name','value',res));
                    }
                }
            })
        }
    };
    var TableInit = function () {
        var oTableInit = new Object();
        var url = basePath + "/rest/test-model-detail/get-rule-list";
        //初始化Table
        oTableInit.Init = function () {
            $('#table').bootstrapTable({
                url: url,         //请求后台的URL（*）
                method: 'post',                      //请求方式（*）
                cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
                sortable: true,                     //是否启用排序
                sortOrder: "asc",                   //排序方式
                queryParams: oTableInit.queryParams,//传递参数（*）
                responseHandler: function (res) {
                    tools.scoreTotal = 0;
                    tools.ruleTimesTotal = 0;
                    tools.fateful = 0;
                    tools.noFateful = 0;
                    if (res.code != 0) {
                        toastrCog.error(res.msg, 1000)
                    }
                    $("#modelName").html("&nbsp;&nbsp;模型名称：" + $("#modelName1").html());
                    if(res.data.length>0){
                        var numAll=0;
                        for(var i=0;i<res.data.length;i++){
                            if(res.data[i].ruleDetails){
                                var detail=res.data[i].ruleDetails;
                                for(var j=0;j<detail.length;j++){
                                    var  proStatus=detail[j].proStatus;
                                    if(proStatus==1){
                                        numAll++;
                                    }
                                }
                            }
                        }
                        rule.ruleAllData=numAll;
                    }
                    return {
                        "total": res.data.length,//总页数
                        "rows": res.data   //数据
                    };
                },
                sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
                pageNumber: 1,                       //初始化加载第一页，默认第一页
                pageSize: 10,                       //每页的记录行数（*）
                pageList: [10, 25, 50, 100],        //可供选择的每页的行数（*）
                search: false,                       //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大
                contentType: "application/x-www-form-urlencoded",
                strictSearch: true,
                showColumns: false,                  //是否显示所有的列
                showRefresh: false,                  //是否显示刷新按钮
                minimumCountColumns: 2,             //最少允许的列数
                clickToSelect: false,                //是否启用点击选中行
                uniqueId: "no",                     //每一行的唯一标识，一般为主键列
                showToggle: false,                    //是否显示详细视图和列表视图的切换按钮
                cardView: false,                    //是否显示详细视图
                detailView: true,
                cellStyle: {
                    css: {"background-color": "#fff"}
                },//是否显示父子表
                onClickRow: function (row, tr) {
                    tr.find(".detail-icon").click();
                },
                onResetView:function(){
                    if(rule.isOpen){
                        $("#table thead tr th:last").html('<a href="javascript:;" class="detail-icon" style="margin-left: 8px;" title="全部收起"><i class="glyphicon glyphicon-chevron-up"></i></a>');
                    }else{
                        $("#table thead tr th:last").html('<a href="javascript:;" class="detail-icon" style="margin-left: 8px;" title="全部展开"><i class="glyphicon glyphicon-chevron-down"></i></a>');
                    }
                },
                columns: [
                    {
                        title: '序号',//标题  可不加
                        width: 60,
                        formatter: function (value, row, index) {
                            return (index + 1) + "";
                        }
                    },
                    {
                        field: 'modelName',
                        title: '质检模型名称',
                        visible: false,
                    },
                    {
                        field: 'ruleName',
                        title: '质检规则名称'
                    },
                    {
                        field: 'useFor',
                        title: '属性',
                        formatter: function (value, row, index) {
                            var str = "";
                            if (value == 0) {
                                str = "系统"
                            } else {
                                str = "人工"
                            }
                            return str;
                        }
                    }, {
                        field: 'fateful',
                        title: '致命性',
                        formatter: function (value, row, index) {
                            var str = "";
                            if (value == 0) {
                                str = "否"
                                tools.noFateful++;
                            } else if (value ==1) {
                                str = "是"
                                tools.fateful++;
                            }
                            return str;
                        }
                    }, {
                        field: 'ruleTimes',
                        title: '命中量',
                        formatter: function (value, row, index) {
                            var length = 1;
                            tools.ruleTimesTotal+=length;
                            return '<a>' + length + '</a>';

                        }
                    }, {
                        field: 'ruleScore',
                        title: '分值',
                        formatter: function (value, row, index) {
                            return value;
                        }
                    }
                ],
                onLoadSuccess: function (data) {  //加载成功时执行
                    if (!data.total || data.total == 0) {
                        $(".no-records-found").find("td").html('<img src="../../../assert/image/nodata.png" th:src="@{/assert/image/nodata.png}" style="width:165px;" alt="">');
                    }
                    $("#ruleHit").find("span").html(tools.ruleTimesTotal);
                    $("#lethality").find("span").html(tools.fateful);
                    $("#noLethality").find("span").html(tools.noFateful);
                    $("tbody .detail-icon").on("click", function () {
                        var tr = $(this).parents("tr");
                        if (tr.hasClass("active")) {
                            tr.removeClass("active");
                        } else {
                            tr.addClass("active");
                        }
                        var num=0;//点击tody的icon时 如果全部展开了改变总按钮改为展开状态 如果全部收起了改变总按钮改为收起状态
                        $("tbody .detail-icon").each(function(){
                           if($(this).find("i").hasClass("glyphicon-chevron-up")){
                               num++;
                           }else{
                               num--;
                           }
                           if(num!=0){
                               if(Math.abs(num)==data.total){
                                   if(num>0){
                                       rule.isOpen=true;
                                       $("#table thead tr th:last").html('<a href="javascript:;" class="detail-icon" style="margin-left: 8px;" title="全部收起"><i class="glyphicon glyphicon-chevron-up"></i></a>');
                                   }else  if(num<0){
                                       rule.isOpen=false;
                                       $("#table thead tr th:last").html('<a href="javascript:;" class="detail-icon" style="margin-left: 8px;" title="全部展开"><i class="glyphicon glyphicon-chevron-down"></i></a>');
                                   }
                               }
                           }
                        })
                    })
                },
                onLoadError: function () {  //加载失败时执行
                    $(".no-records-found").find("td").html('<img src="../../../assert/image/nodata.png" th:src="@{/assert/image/nodata.png}" style="width:165px;" alt="">');
                },
                formatLoadingMessage: function () {
                    return '<div class="loaded">' +
                        '<div class="loader">' +
                        '<div class="loader-inner line-scale-pulse-out">' +
                        '<div></div>' +
                        '<div></div>' +
                        '<div></div>' +
                        '<div></div>' +
                        '<div></div>' +
                        '</div>' +
                        '</div>' +
                        '</div>' +
                        '<div>请稍等，数据正在加载中...</div>';
                },      //注册加载子表的事件。你可以理解为点击父表中+号时触发的事件
                onExpandRow: function (index, row, $detail) {
                    //这一步就是相当于在当前点击列下新创建一个table
                    var data = row.voiceSegments;
                    if (data && data.length > 0) {
                        var explainBox = $('<div class="explainBox">' +
                            '<ul>' +
                                '<li>' +
                                    '<div class="ruleBox">命中时间：' +
                                    '</div>'+
                                '</li>'+
                            '</ul>' +
                            '</div>');
                        for (var i = 0; i < data.length; i++) {
                            var voiceSegments = data[i];
                            var ruleBox = explainBox.find(".ruleBox");
                            var startTime = voiceSegments.startTime;
                            var endTime = voiceSegments.endTime;
                            ruleBox.append('<span class="ruleTime" data-sTime="' + startTime + '" data-eTime="' + endTime + '"><i class="fa fa-volume-up"></i>' + base.formatSeconds(startTime) + '-' + base.formatSeconds(endTime) + '</span></div>');
                        }
                        $detail.html(explainBox); // 关键地方
                    }
                },
            });
        };
        //得到查询的参数
        oTableInit.queryParams = function (params) {
            var temp = {   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                workId: $("#workId").html(),
                serialNumber: $("#serialNumber").html()
            };
            return temp;
        };
        return oTableInit;
    };
    var rule = {
        selectRuleArr: [],
        hasRuleArr: [],
        appealData: [],
        ruleAllData:0,
        isOpen:false,
        init: function () {
            var oTable = new TableInit();
            oTable.Init();
            rule.ruleDblclick();
            $("#table").on("click", ".detail", function () {
                var i=$(this).find("i");
                var a=$(this).find("a");
                var glyphicon="";
                if(i.hasClass("glyphicon-chevron-down")){
                    rule.isOpen=true;
                    glyphicon="glyphicon-chevron-down";
                }else{
                    rule.isOpen=false;
                    glyphicon="glyphicon-chevron-up";
                }
                $("#table tbody tr").each(function(){
                    var icon=$(this).find(".detail-icon");
                    var iElem=icon.find("i");
                    if(iElem.hasClass(glyphicon)){
                        icon.click();
                    }
                })
            });
        },
        ruleDblclick: function () {
            $('#table').on("click", ".ruleTime", function (event) {
                var sTime = parseFloat($(this).attr('data-sTime'));
                var eTime = parseFloat($(this).attr('data-eTime'));
                if (sTime!=null && eTime!=null) {
                    wave.playRegion(sTime, eTime);
                }
            });
        },
        tableRefresh: function () {
            $("#table").bootstrapTable("refresh");
        }
    };

    $(function () {
        getData.init();
        wave.init();
        tools.init();
        base.init();
        stt.init();
        tag.init();
        rule.init();

        setTimeout(function(){
            resize.init();
        },200)
    })
</script>
</body>
</html>